home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / Editions.a < prev    next >
Encoding:
Text File  |  1993-11-30  |  11.2 KB  |  483 lines  |  [TEXT/MPS ]

  1. ;    File:        Editions.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1 for ETO #11
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__INCLUDINGEDITIONS__') = 'UNDEFINED' THEN
  12. __INCLUDINGEDITIONS__    SET    1
  13.  
  14.     IF &TYPE('__INCLUDINGFSEQU__') = 'UNDEFINED' THEN        ; get definition of FSSpec
  15.     INCLUDE     'FSEqu.a'
  16.     ENDIF
  17.  
  18.  
  19.  
  20. ; resource types 
  21. rSectionType                EQU     'sect'
  22.  
  23. ; section types 
  24. stSubscriber                EQU     $01
  25. stPublisher                 EQU     $0A
  26.  
  27. ; Update Modes 
  28. sumAutomatic                EQU        0    ; subscriber update mode - Automatically 
  29. sumManual                    EQU        1    ; subscriber update mode - Manually 
  30. pumOnSave                    EQU        0    ; publisher update mode - On Save 
  31. pumManual                    EQU        1    ; publisher update mode - Manually 
  32.     
  33. ; EditionContainer subpart usage 
  34. kPartsNotUsed                EQU         0
  35. kPartNumberUnknown            EQU        -1
  36.  
  37. ; preview size 
  38. kPreviewWidth                EQU        120
  39. kPreviewHeight                EQU        120
  40.  
  41. ; special formats 
  42. kPublisherDocAliasFormat    EQU        'alis'     ; same as rAliasType
  43. kPreviewFormat                EQU        'prvw'
  44. kFormatListFormat            EQU        'fmts'
  45.  
  46. ; bits for formatsMask 
  47. kPICTformatMask                EQU        1
  48. kTEXTformatMask                EQU        2
  49. ksndFormatMask                EQU        4
  50.  
  51. ; Finder types for edition files 
  52. kPICTEditionFileType        EQU        'edtp'
  53. kTEXTEditionFileType        EQU        'edtt'
  54. ksndEditionFileType            EQU        'edts'
  55. kUnknownEditionFileType        EQU        'edtu'
  56.  
  57. ; pseudo-item hits for dialogHooks 
  58. ; the first is for NewPublisher or NewSubscriber Dialogs 
  59. emHookRedrawPreview            EQU     150
  60. ; the following are for SectionOptions Dialog 
  61. emHookCancelSection            EQU        160    
  62. emHookGoToPublisher            EQU        161
  63. emHookGetEditionNow            EQU        162
  64. emHookSendEditionNow        EQU        162
  65. emHookManualUpdateMode        EQU        163
  66. emHookAutoUpdateMode        EQU        164
  67.  
  68.  
  69. ; the refcon field of the dialog record in a modalfilter or 
  70. ; dialoghook during SectionOptionsDialog contains one the following 
  71. emOptionsDialogRefCon        EQU        'optn'
  72. emCancelSectionDialogRefCon    EQU        'cncl'
  73. emGoToPubErrDialogRefCon    EQU        'gerr'
  74.  
  75.  
  76. ; misc 
  77. kFormatLengthUnknown        EQU        -1
  78.  
  79.  
  80. ; record definitions
  81. ;
  82. SectionRecord    RECORD    0
  83. version            DS.B    1    ;    SignedByte         { always 1 in 7.0 release }
  84. kind            DS.B    1    ;    SectionType        { publisher or subscriber }
  85. mode            DS.W    1    ;    UpdateMode         { auto or manual }
  86. mdDate             DS.L    1    ;    TimeStamp        { version of data in section }
  87. sectionID        DS.L    1    ;    LONGINT            { application specific, unique per document }
  88. refCon             DS.L    1    ;    LONGINT            { application specific }
  89. alias            DS.L    1    ;    AliasHandle        { handle to Alias Record }
  90. ; the following fields are private and set up by RegisterSection 
  91. subPart            DS.L    1    ;    LONGINT            { which part of container,  always kPartsNotUsed in 7.0 }
  92. nextSection        DS.L    1    ;    SectionHandle    { for linked list of app's Sections }
  93. controlBlock    DS.L    1    ;    Handle            { shared controlblock for this section. }
  94. refNum             DS.L    1    ;    EditionRefNum    { NIL outside of Open/CloseEdition }
  95. size            EQU        *
  96.                 ENDR
  97.  
  98.  
  99. EditionContainerSpec RECORD 0
  100. theFile                DS        FSSpec                 ;
  101. theFileScript        DS.W    1                     ;    ScriptCode
  102. thePart                DS.L    1                     ;    LONGINT
  103. thePartName            DS.B    32                     ;    Str31
  104. thePartScript        DS.W    1                     ;    ScriptCode
  105. size                EQU        *
  106.                     ENDR        
  107.  
  108.  
  109. EditionInfoRecord    RECORD 0
  110. crDate                DS.L    1                     ;     Timestamp        { date EditionContainer was created }
  111. mdDate                DS.L    1                     ;     Timestamp        { date of last change }
  112. fdCreator            DS.B    4                     ;     OSType            { file creator }
  113. fdType                DS.B    4                     ;     OSType         { file type, 'edtT', etc }
  114. container            DS        EditionContainerSpec ;                    { the Edition }
  115. size                EQU        *
  116.                     ENDR
  117.  
  118. NewPublisherReply    RECORD 0
  119. canceled            DS.B    1                     ;    BOOLEAN            { O }
  120. replacing            DS.B    1                     ;    BOOLEAN            { O }    
  121. usePart                DS.B    1                     ;    BOOLEAN            { I }
  122. pad1                DS.B    1                     ;    
  123. preview                DS.L    1                     ;    Handle             { I }
  124. previewFormat        DS.B    4                     ;    FormatType         { I }
  125. container            DS        EditionContainerSpec ;                    { I/O }
  126. size                EQU        *
  127.                     ENDR
  128.  
  129. NewSubscriberReply    RECORD 0
  130. canceled            DS.B    1                     ;    BOOLEAN            { O }
  131. formatsMask            DS.B    1                     ;    SignedByte        { I }
  132. container            DS        EditionContainerSpec ;                    { I/O }
  133. size                EQU        *
  134.                     ENDR
  135.  
  136. SectionOptionsReply RECORD 0
  137. canceled            DS.B    1                     ;    BOOLEAN            { O }
  138. changed                DS.B    1                     ;    BOOLEAN            { O }
  139. sectionH            DS.L    1                     ;    SectionHandle    { I }
  140. action                DS.B    4                     ;     ResType            { 0 }
  141. size                EQU        *
  142.                     ENDR
  143.  
  144.  
  145. ; FormatIOVerb's
  146. ioHasFormat            EQU        0
  147. ioReadFormat        EQU        1
  148. ioNewFormat            EQU        2
  149. ioWriteFormat        EQU        3
  150.  
  151. FormatIOParamBlock    RECORD 0
  152. ioRefNum            DS.L    1                     ;    LONGINT
  153. format                DS.B    4                     ;     FormatType
  154. formatIndex            DS.L    1                     ;    LONGINT
  155. offset                DS.L    1                     ;     LONGINT
  156. buffPtr                DS.L    1                     ;    Ptr
  157. buffLen                DS.L    1                     ;    LONGINT
  158. size                EQU        *
  159.                     ENDR
  160.  
  161.  
  162. ; EditionOpenerVerb's
  163. eoOpen                EQU        0
  164. eoClose                EQU        1
  165. eoOpenNew            EQU        2
  166. eoCloseNew            EQU        3
  167. eoCanSubscribe        EQU        4
  168.  
  169. EditionOpenerParamBlock RECORD 0
  170. info                DS        EditionInfoRecord     ;
  171. sectionH            DS.L    1                     ;    SectionHandle
  172. document            DS.L    1                     ;    FSSpecPtr
  173. fdCreator            DS.B    4                     ;    OSType
  174. ioRefNum            DS.L    1                     ;    LONGINT
  175. ioProc                DS.L    1                     ;     FormatIOProcPtr
  176. success                DS.B    1                     ;    BOOLEAN
  177. formatsMask            DS.B    1                     ;    SignedByte    
  178. size                EQU        *
  179.                         ENDR
  180.  
  181.  
  182. ; Section Events
  183. sectionEventMsgClass    EQU     'sect'
  184. sectionReadMsgID        EQU     'read'
  185. sectionWriteMsgID        EQU     'writ'
  186. sectionScrollMsgID        EQU     'scrl'
  187. sectionCancelMsgID        EQU     'cncl'
  188.     
  189. ;    Section events now arrive in the message buffer using the AppleEvent format.
  190. ;    The direct object parameter is an aeTemporaryIDParamType ('tid '). The temporary
  191. ;    ID's type is rSectionType ('sect') and the 32-bit value is a SectionHandle.
  192. ;    The following is a sample buffer
  193. ;    
  194. ;    name            offset    contents
  195. ;    ----            ------    --------
  196. ;    
  197. ;    header            0        'aevt'
  198. ;    majorVersion    4        $01
  199. ;    minorVersion    6        $01
  200. ;    endOfMetaData    8        ';;;;' 
  201. ;    directObjKey    12        '----' 
  202. ;    paramType        16        'tid ' 
  203. ;    paramLength        20        $0008 
  204. ;    tempIDType        24        'sect' 
  205. ;    tempID             28        the SectionHandle <-- this is want you want
  206. ;
  207.  
  208.     
  209. ;    FUNCTION InitEditionPack: OSErr;
  210.         MACRO
  211.         _InitEditionPack
  212.         MOVE.W     #$0011,-(SP)
  213.         MOVE.W     #$0100,D0
  214.         _Pack11
  215.         ENDM
  216.  
  217.  
  218. ;    FUNCTION NewSection(container: EditionContainerSpec;
  219. ;                        sectionDocument: FSSpecPtr; 
  220. ;                        kind: SectionType;
  221. ;                        sectionID: LONGINT;
  222. ;                        initalMode: UpdateMode; 
  223. ;                        VAR sectionH: SectionHandle): OSErr;
  224.         MACRO
  225.         _NewSection
  226.         MOVE.W     #$0A02,D0
  227.         _Pack11
  228.         ENDM
  229.  
  230.     
  231. ;    FUNCTION RegisterSection(sectionDocument: FSSpec; sectionH: SectionHandle;
  232. ;                            VAR aliasWasUpdated: BOOLEAN): OSErr;
  233.         MACRO
  234.         _RegisterSection
  235.         MOVE.W     #$0604,D0
  236.         _Pack11
  237.         ENDM
  238.  
  239.     
  240.  
  241. ;    FUNCTION UnRegisterSection(sectionH: SectionHandle): OSErr;
  242.         MACRO
  243.         _UnRegisterSection
  244.         MOVE.W     #$0206,D0
  245.         _Pack11
  246.         ENDM
  247.  
  248.  
  249.  
  250. ;    FUNCTION IsRegisteredSection(sectionH: SectionHandle): OSErr;
  251.         MACRO
  252.         _IsRegisteredSection
  253.         MOVE.W     #$0208,D0
  254.         _Pack11
  255.         ENDM
  256.  
  257.  
  258.     
  259. ;    FUNCTION AssociateSection(sectionH: SectionHandle; newSectionDocument: FSSpecPtr): OSErr;
  260.         MACRO
  261.         _AssociateSection
  262.         MOVE.W     #$040C,D0
  263.         _Pack11
  264.         ENDM
  265.  
  266.     
  267. ;    FUNCTION CreateEditionContainerFile(editionFile: FSSpec; fdCreator: OSType;
  268. ;                                        editionFileNameScript: ScriptCode): OSErr;
  269.         MACRO
  270.         _CreateEditionContainerFile
  271.         MOVE.W     #$050E,D0
  272.         _Pack11
  273.         ENDM
  274.     
  275.     
  276. ;    FUNCTION DeleteEditionContainerFile(editionFile: FSSpec): OSErr;
  277.         MACRO
  278.         _DeleteEditionContainerFile
  279.         MOVE.W     #$0210,D0
  280.         _Pack11
  281.         ENDM
  282.     
  283.         
  284.     
  285. ;    FUNCTION OpenEdition(subscriberSectionH: SectionHandle; 
  286. ;                            VAR refNum: EditionRefNum): OSErr;
  287.         MACRO
  288.         _OpenEdition
  289.         MOVE.W     #$0412,D0
  290.         _Pack11
  291.         ENDM
  292.     
  293.     
  294. ;    FUNCTION OpenNewEdition(publisherSectionH: SectionHandle; fdCreator: OSType;
  295. ;                            publisherSectionDocument: FSSpecPtr;
  296. ;                            VAR refNum: EditionRefNum): OSErr;
  297.         MACRO
  298.         _OpenNewEdition
  299.         MOVE.W     #$0814,D0
  300.         _Pack11
  301.         ENDM
  302.     
  303.     
  304. ;    FUNCTION CloseEdition(whichEdition: EditionRefNum; successful: BOOLEAN): OSErr;
  305.         MACRO
  306.         _CloseEdition
  307.         MOVE.W     #$0316,D0
  308.         _Pack11
  309.         ENDM
  310.  
  311.  
  312. ;    FUNCTION EditionHasFormat(whichEdition: EditionRefNum; whichFormat: FormatType;
  313. ;                                VAR formatSize: Size): OSErr;
  314.         MACRO
  315.         _EditionHasFormat
  316.         MOVE.W     #$0618,D0
  317.         _Pack11
  318.         ENDM
  319.     
  320.     
  321. ;    FUNCTION ReadEdition(whichEdition: EditionRefNum; whichFormat: FormatType;
  322. ;                            buffPtr: Ptr; VAR buffLen: Size): OSErr;
  323.         MACRO
  324.         _ReadEdition
  325.         MOVE.W     #$081A,D0
  326.         _Pack11
  327.         ENDM
  328.     
  329.     
  330. ;    FUNCTION WriteEdition(whichEdition: EditionRefNum; whichFormat: FormatType;
  331. ;                            buffPtr: Ptr; buffLen: Size): OSErr;
  332.         MACRO
  333.         _WriteEdition
  334.         MOVE.W     #$081C,D0
  335.         _Pack11
  336.         ENDM
  337.     
  338.     
  339. ;    FUNCTION GetEditionFormatMark(whichEdition: EditionRefNum; whichFormat: FormatType;
  340. ;                                VAR currentMark: LONGINT): OSErr;
  341.         MACRO
  342.         _GetEditionFormatMark
  343.         MOVE.W     #$061E,D0
  344.         _Pack11
  345.         ENDM
  346.     
  347.     
  348. ;    FUNCTION SetEditionFormatMark(whichEdition: EditionRefNum; whichFormat: FormatType;
  349. ;                                setMarkTo: LONGINT): OSErr;
  350.         MACRO
  351.         _SetEditionFormatMark
  352.         MOVE.W     #$0620,D0
  353.         _Pack11
  354.         ENDM
  355.  
  356.  
  357.  
  358. ;    FUNCTION GetEditionInfo(sectionH: SectionHandle; VAR editionInfo: EditionInfoRecord): OSErr;
  359.         MACRO
  360.         _GetEditionInfo
  361.         MOVE.W     #$0422,D0
  362.         _Pack11
  363.         ENDM
  364.         
  365.         
  366. ;    FUNCTION GoToPublisherSection(container: EditionContainerSpec): OSErr;
  367.         MACRO
  368.         _GoToPublisherSection
  369.         MOVE.W     #$0224,D0
  370.         _Pack11
  371.         ENDM
  372.     
  373.     
  374. ;    FUNCTION GetLastEditionContainerUsed(VAR container: EditionContainerSpec): OSErr;    
  375.         MACRO
  376.         _GetLastEditionContainerUsed
  377.         MOVE.W     #$0226,D0
  378.         _Pack11
  379.         ENDM
  380.         
  381.         
  382. ;    FUNCTION GetStandardFormats(container: EditionContainerSpec; VAR previewFormat: FormatType;
  383. ;                                    preview, publisherAlias, formats: Handle): OSErr;
  384.         MACRO
  385.         _GetStandardFormats
  386.         MOVE.W     #$0A28,D0
  387.         _Pack11
  388.         ENDM
  389.     
  390.  
  391. ;    FUNCTION GetEditionOpenerProc(VAR opener: EditionOpenerProcPtr): OSErr;
  392.         MACRO
  393.         _GetEditionOpenerProc
  394.         MOVE.W     #$022A,D0
  395.         _Pack11
  396.         ENDM
  397.         
  398.  
  399. ;    FUNCTION SetEditionOpenerProc(opener: EditionOpenerProcPtr): OSErr;
  400.         MACRO
  401.         _SetEditionOpenerProc
  402.         MOVE.W     #$022C,D0
  403.         _Pack11
  404.         ENDM
  405.  
  406.  
  407. ;    FUNCTION CallEditionOpenerProc(selector: EditionOpenerVerb; VAR PB: EditionOpenerParamBlock;
  408. ;                            routine: EditionOpenerProcPtr): OSErr;
  409.         MACRO
  410.         _CallEditionOpenerProc
  411.         MOVE.W     #$052E,D0
  412.         _Pack11
  413.         ENDM
  414.  
  415.  
  416. ;    FUNCTION CallFormatIOProc(selector: FormatIOVerb; VAR PB: FormatIOParamBlock;
  417. ;                            routine: FormatIOProcPtr): OSErr;
  418.         MACRO
  419.         _CallFormatIOProc
  420.         MOVE.W     #$0530,D0
  421.         _Pack11
  422.         ENDM
  423.             
  424.  
  425.  
  426.  
  427. ;    FUNCTION NewSubscriberDialog(VAR reply: NewSubscriberReply): OSErr;
  428.         MACRO
  429.         _NewSubscriberDialog
  430.         MOVE.W     #$0232,D0
  431.         _Pack11
  432.         ENDM
  433.     
  434.     
  435. ;    FUNCTION NewSubscriberExpDialog(VAR reply: NewSubscriberReply; where: Point;
  436. ;                                    expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr;
  437. ;                                    filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
  438.         MACRO
  439.         _NewSubscriberExpDialog
  440.         MOVE.W     #$0B34,D0
  441.         _Pack11
  442.         ENDM
  443.     
  444.     
  445. ;    FUNCTION NewPublisherDialog(VAR reply: NewPublisherReply): OSErr;
  446.         MACRO
  447.         _NewPublisherDialog
  448.         MOVE.W     #$0236,D0
  449.         _Pack11
  450.         ENDM
  451.     
  452.     
  453. ;    FUNCTION NewPublisherExpDialog(VAR reply: NewPublisherReply; where: Point;
  454. ;                                    expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr;
  455. ;                                    filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
  456.         MACRO
  457.         _NewPublisherExpDialog
  458.         MOVE.W     #$0B38,D0
  459.         _Pack11
  460.         ENDM
  461.     
  462.     
  463. ;    FUNCTION SectionOptionsDialog(VAR reply: SectionOptionsReply): OSErr;
  464.         MACRO
  465.         _SectionOptionsDialog
  466.         MOVE.W     #$023A,D0
  467.         _Pack11
  468.         ENDM
  469.     
  470.     
  471. ;    FUNCTION SectionOptionsExpDialog(VAR reply: SectionOptionsReply; where: Point;
  472. ;                                    expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr;
  473. ;                                    filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
  474.         MACRO
  475.         _SectionOptionsExpDialog
  476.         MOVE.W     #$0B3C,D0
  477.         _Pack11
  478.         ENDM
  479.         
  480.  
  481.  
  482.     ENDIF    ; ...already included